static-lib=libmylog.a
dynamic-lib=libmylog.so 

mylog.exe:main.c all
	gcc main.c -lmyloga -lmylogso -o mylog.exe
.PHONY:all
all:$(static-lib) $(dynamic-lib)

$(static-lib):mysort.o
	ar -rc $@ $^ 
$(dynamic-lib):mystring.o
	gcc -shared $^ -o $@
mysort.o:mysort.c
	gcc -c $^ -o $@
mystring.o:mystring.c
	gcc -fPIC -c $^ -o $@

.PHONY:clean
clean:
	rm -rf *.o *.a *.so *.exe

.PHONY:output
output:
	mkdir -p ./mylib/include
	mkdir -p ./mylib/lib 
	cp *.h ./mylib/include 
	cp *.a ./mylib/lib 
	cp *.so ./mylib/lib
